{% load currency_filters %}
{% load category_tags %}
{% load i18n %}

<div class="navbar primary navbar-static-top navbar-inverse">
    <div class="navbar-inner">
        <div class="container-fluid">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".primary-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <a class="btn btn-navbar btn-cart visible-phone" href="{% url checkout:index %}">
                <i class="icon-shopping-cart"></i>
                <strong>{% trans "Basket" %}
                {% if request.basket.all_lines.count %}
                {% trans "Total:" %} {{ basket.total_incl_tax|currency }}
                {% endif %}
                </strong>
            </a>

            <div class="nav-collapse primary-collapse">
                <ul class="nav">
                    <li><a tabindex="-1" href="{% url catalogue:index %}">{% trans "All" %}</a></li>
                    {% for category in categories %}
                    <li class="dropdown">
                        {% if category.1 %}
                            <a tabindex="-1" href="{{ category.0.get_absolute_url }}" data-toggle="dropdown" class="dropdown-toggle">{{ category.0.name }} {% if category.1 %}<i class="icon-arrow-down"></i>{% endif %}</a>
                            <ul class="dropdown-menu">
                                {% for subcategory in category.1 %}
                                    <li><a tabindex="-1" href="{{ subcategory.0.get_absolute_url }}"> {{ subcategory.0.name }} <i class="icon-arrow-right"></i></a></li>
                                {% endfor %}
                                <li class="divider"></li>
                                <li><a tabindex="-1" href="{{ category.0.get_absolute_url }}">All {{ category.0.name }} <i class="icon-arrow-right"></i></a></li>
                            </ul>
                        {% else %}
                            <a tabindex="-1" href="{{ category.0.get_absolute_url }}">{{ category.0.name }}</a>
                        {% endif %}
                    </li>
                    {% endfor %}
                </ul>
                {% include "partials/search.html" %}
            </div><!-- /.nav-collapse -->
        </div>
    </div><!-- /navbar-inner -->
</div><!-- /navbar -->
